<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.js"></script>
    <script>
    $(function (){
    $("btn").click(function(){
        $.get("login",$("#loginForm").serialize(),function (res) {
            if (res.flag){
                location.href="main.html";
            }else {
                $("err_msg").html(res.message);
            }
        },"json");
    })

    })


  </script>
</head>
<body>
    <form name=""></form>
    <input type="text" >
</body>
</html>